<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>河南省滑县新华书店包乡组专用</title>
<#assign base=request.contextPath  />
</head>
<link rel="stylesheet" href="${base}/js/layui/css/layui.css?t=1534970980648" media="all">

<script type="text/javascript" src="${base}/js/ztree/jquery-1.4.4.min.js"></script>

<body style="background: blue">
<h1 style="text-align: center">河南省滑县新华书店</h1>
<h1 style="text-align: center">包乡组专用</h1>
<div style="text-align: center">
    <font  size="30">账户：</font><input style="width: 500px;height: 50px" id="userName"   placeholder="请输入账户"></input></br>
    <font  size="30">密码：</font><input id="passWord" style="width: 500px;height: 50px" type="password" placeholder="请输入密码"></input></br>
    <button id="sub" style="width: 500px;height: 50px" onclick="login()">登陆</button>

</div>

</body>
<script src="${base}/js/layui/layui.js" charset="utf-8"></script>
<script src="${base}/js/jquery.min.js"></script>

<script>
    layui.use(['form','layer'], function(){
        var form = layui.form
                ,layer = layui.layer;

    });

    function login (){
        $.ajax({
            type : "POST", //提交方式
            url : "${base}/user/login",//路径
            data :{userName:$("#userName").val(),passWord:$("#passWord").val()},
            success : function(data) {//返回数据根据结果进行相应的处理
                if(JSON.parse(data).success===true){
                    toSelect();
                }else{
                    layer.msg("账户密码错误，登陆失败")
                }

            }
        });
    }

    function toSelect(){
        layer.open({
            type: 2 //此处以iframe举例
            ,title: '请选择'
            ,area: ['350px', '450px']
            ,shade: 0
            ,offset: 'auto'
            ,content: ['${base}/user/select.html','no']
            ,zIndex: layer.zIndex //重点1
            ,success: function(layero){

            }
        });
    }
</script>
</html>